- /* sfofdvdb.cpp by K.Tsuru */
- // function ID = 725, 735 DRADIX
- /***********************************
- SFraction class
- It provides the division by double.
- ************************************/
- #ifndef SN_H
- #include "sn.h"
- #endif
- // m/d
- SFraction operator/(const SFraction& m, double d){
- if(d == 0.0) m.num.SetError(m.num.DIVIDED_BY_ZERO,"SF/double", 735);
- SFraction r;
- if( !m.Sign(735) ) r.SetZero();
- else if(d == 1.0L) r = m;
- else if(d == -1.0L) r = -m;
- else r.Set(m.NumNR(), m.DenNR()*d); // includes r.reduce(0);
- return r;
- }
sfofdvdb.cpp : last modifiled at 2016/04/22 11:18:11(556 bytes)
created at 2015/12/22 16:07:29
The creation time of this html file is 2016/09/13 19:56:38 (Tue Sep 13 19:56:38 2016).